#include<bits/stdc++.h>
#define LL long long
#define SZ(x) ((LL)(x.size()))
#define all(x) (x).begin(),(x).end()
using namespace std;
inline LL read(){
  LL q=0,w=1;char ch=getchar();
  while(ch>'9' || ch<'0'){if(ch=='-')w=-1;ch=getchar();}
  while(ch>='0'&&ch<='9'){q=q*10+(ch-'0');ch=getchar();}
  return q*w;
}
void write(LL x){
  if(x<0){putchar('-');x=(-x);}
  if(x>9)write(x/10);
  putchar('0'+x%10);
}
inline void writeln(LL x){write(x);puts("");}
inline void writecs(LL x){write(x);putchar(' ');}

inline LL qpow(LL a,LL b,LL p){LL ans=1;while(b){if(b&1)ans=(ans*a)%p;b>>=1;a=(a*a)%p;}return ans;}
const LL mod = 998244353;
inline void amod(LL &x,LL y){x+=y;if(x>=mod)x-=mod;}
inline void smod(LL &x,LL y){x-=y;if(x<0)x+=mod;}
inline LL dmod(LL x){if(x<0)x+=mod;if(x>=mod)x-=mod;return x;}
inline LL inv(LL x){return qpow(x,mod-2,mod);}

const LL N = 300+95;
LL n;char ch[N];LL a[N],ans,mx[N][N],mn[N][N];

inline bool check(){
  vector<LL>sum(n+2);
  for(LL i=1;i<=n;i++)sum[i]=sum[i-1]+a[i];

  //  cout<<" a : ";for(LL i=1;i<=n;i++)cout<<a[i]<<" ";cout<<endl;
  
  if(sum[n]==0){
    LL fl=1;
    for(LL i=1;i<=n;i++)
      if(sum[i]<0){fl=0;break;}
    if(fl)return true;
  }

  for(LL i=1;i<=n;i++)mx[i][i]=mn[i][i]=sum[i];
  for(LL len=2;len<=n;len++){
    for(LL i=1;i<=n-len+1;i++){
      LL j=i+len-1;
      mx[i][j]=max(mx[i+1][j],mx[i][j-1]);
      mn[i][j]=min(mn[i+1][j],mn[i][j-1]);
    }
  }
  for(LL i=1;i<=n;i++)
    for(LL j=1;j<=n;j++){
      LL fl=1;
      if(((sum[j]-sum[i-1])<<1)!=sum[n]){fl=0;}
      if(1<=i-1&&mn[1][i-1]<0){fl=0;}
      if(mx[i][j]>(sum[i-1]<<1)){fl=0;}
      if(j+1<=n&&mn[j+1][n]<sum[n]){fl=0;}
      if(fl){
	//	cout<<"> i = "<<i<<" j = "<<j<<endl;
	return true;
      }
    }
  return false;
}
void dfs(LL t){
  if(t>n){
    if(check())amod(ans,1);
    return ;
  }
  if(ch[t]!=')'){a[t]=1;dfs(t+1);}
  if(ch[t]!='('){a[t]=-1;dfs(t+1);}
  return ;
}
int main(){
  freopen("bracket.in","r",stdin);
  freopen("bracket.out","w",stdout);
  n=read();scanf("%s",ch+1);
  if((n&1)){puts("0");return 0;}

  dfs(1);
  writeln(ans);
  return 0;
}
